From 1bf21d3dba1f6c95d3562ab9a2fb98235122c4ba Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 14 Oct 2020 22:27:09 -0400 Subject: [PATCH] Document accessible roles for stacks and notebooks This was forgotten when I implemented the Tabs pattern. --- docs/reference/gtk/section-accessibility.md | 3 +++ gtk/gtkenums.h | 6 +++--- gtk/gtknotebook.c | 6 ++++++ gtk/gtkstack.c | 5 +++++ gtk/gtkstackswitcher.c | 5 +++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/reference/gtk/section-accessibility.md b/docs/reference/gtk/section-accessibility.md index 37309df83b..d60713c394 100644 --- a/docs/reference/gtk/section-accessibility.md +++ b/docs/reference/gtk/section-accessibility.md @@ -63,6 +63,9 @@ Each role name is part of the #GtkAccessibleRole enumeration. | `SEPARATOR` | A divider that separates sections of content or groups of items | #GtkSeparator | | `SPIN_BUTTON` | A range control that allows seelcting among discrete choices | #GtkSpinButton | | `SWITCH` | A control that represents on/off values | #GtkSwitch | +| `TAB` | A tab in a list of tabs for switching pages | #GtkStackSwitcher, #GtkNotebook | +| `TAB_LIST` | A list of tabs for switching pages | #GtkStackSwitcher, #GtkNotebook | +| `TAB_PANEL` | A page in a notebook or stack | #GtkStack | | `TEXT_BOX` | A type of input that allows free-form text as its value. | #GtkEntry, #GtkPasswordEntry, #GtkTextView | | `WINDOW` | An application window | #GtkWindow | | `...` | … | diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index 4aa4b8b4e6..d4495da91d 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -1232,10 +1232,10 @@ typedef enum { * @GTK_ACCESSIBLE_ROLE_STRUCTURE: Unused * @GTK_ACCESSIBLE_ROLE_SWITCH: A type of checkbox that represents on/off values, * as opposed to checked/unchecked values. - * @GTK_ACCESSIBLE_ROLE_TAB: Unused + * @GTK_ACCESSIBLE_ROLE_TAB: An item in a list of tab used for switching pages. * @GTK_ACCESSIBLE_ROLE_TABLE: Unused - * @GTK_ACCESSIBLE_ROLE_TAB_LIST: Unused - * @GTK_ACCESSIBLE_ROLE_TAB_PANEL: Unused + * @GTK_ACCESSIBLE_ROLE_TAB_LIST: A list of tabs for switching pages. + * @GTK_ACCESSIBLE_ROLE_TAB_PANEL: A page in a notebook or stack. * @GTK_ACCESSIBLE_ROLE_TEXT_BOX: A type of input that allows free-form text * as its value. * @GTK_ACCESSIBLE_ROLE_TIME: Unused diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 116e7d54d9..81346060c1 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -144,6 +144,12 @@ * A tab node gets the .dnd style class while it is moved with drag-and-drop. * * The nodes are always arranged from left-to-right, regardless of text direction. + * + * # Accessibility + * + * GtkNotebook uses the #GTK_ACCESSIBLE_ROLE_TAB_LIST and + * #GTK_ACCESSIBLE_ROLE_TAB roles for its list of tabs and the + * #GTK_ACCESSIBLE_ROLE_TAB_PANEL for the pages. */ diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index 2c9b53bd07..a9a0902c23 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -80,6 +80,11 @@ * # CSS nodes * * GtkStack has a single CSS node named stack. + * + * # Accessibility + * + * GtkStack uses the #GTK_ACCESSIBLE_ROLE_TAB_PANEL for the stack + * pages. */ /** diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c index 4392cc9cdb..fe6976b762 100644 --- a/gtk/gtkstackswitcher.c +++ b/gtk/gtkstackswitcher.c @@ -59,6 +59,11 @@ * When circumstances require it, GtkStackSwitcher adds the * .needs-attention style class to the widgets representing the * stack pages. + * + * # Accessibility + * + * GtkStackSwitcher uses the #GTK_ACCESSIBLE_ROLE_TAB_LIST role + * and uses the #GTK_ACCESSIBLE_ROLE_TAB for its buttons. */ #define TIMEOUT_EXPAND 500 -- 2.30.2